package com.ruoyi.retirement.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.retirement.domain.RetirementArticleCollectRecord;
import com.ruoyi.retirement.mapper.RetirementArticleCollectRecordMapper;
import com.ruoyi.retirement.service.IRetirementArticleCollectRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 文章报名记录Service业务层处理
 * 
 * @author 曹旭
 * @date 2025-09-08
 */
@Service
public class RetirementArticleCollectRecordServiceImpl implements IRetirementArticleCollectRecordService 
{
    @Autowired
    private RetirementArticleCollectRecordMapper retirementArticleCollectRecordMapper;

    /**
     * 查询文章报名记录
     * 
     * @param id 文章报名记录主键
     * @return 文章报名记录
     */
    @Override
    public RetirementArticleCollectRecord selectRetirementArticleCollectRecordById(Long id)
    {
        return retirementArticleCollectRecordMapper.selectRetirementArticleCollectRecordById(id);
    }

    /**
     * 查询文章报名记录列表
     * 
     * @param retirementArticleCollectRecord 文章报名记录
     * @return 文章报名记录
     */
    @Override
    public List<RetirementArticleCollectRecord> selectRetirementArticleCollectRecordList(RetirementArticleCollectRecord retirementArticleCollectRecord)
    {
        return retirementArticleCollectRecordMapper.selectRetirementArticleCollectRecordList(retirementArticleCollectRecord);
    }

    /**
     * 新增文章报名记录
     * 
     * @param retirementArticleCollectRecord 文章报名记录
     * @return 结果
     */
    @Override
    public int insertRetirementArticleCollectRecord(RetirementArticleCollectRecord retirementArticleCollectRecord)
    {
        retirementArticleCollectRecord.setCreateTime(DateUtils.getNowDate());
        return retirementArticleCollectRecordMapper.insertRetirementArticleCollectRecord(retirementArticleCollectRecord);
    }

    /**
     * 修改文章报名记录
     * 
     * @param retirementArticleCollectRecord 文章报名记录
     * @return 结果
     */
    @Override
    public int updateRetirementArticleCollectRecord(RetirementArticleCollectRecord retirementArticleCollectRecord)
    {
        retirementArticleCollectRecord.setUpdateTime(DateUtils.getNowDate());
        return retirementArticleCollectRecordMapper.updateRetirementArticleCollectRecord(retirementArticleCollectRecord);
    }


}
